package com.xxw.yygh.sms.controller;

import com.xxw.yygh.common.result.R;
import com.xxw.yygh.sms.service.SmsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user/sms")
public class SmsController {

    @Resource
    private SmsService smsService;

    @PostMapping("/send/{phone}")
    public R sendCode(@PathVariable String phone){
        Boolean flag=smsService.sendCode(phone);
        if (flag) {
            return R.ok();
        }else {
            return R.error();
        }
    }

}
